import Base64 from 'js-base64'
import { useEffect } from 'react'

export function toSimplify(num: number) {
    if (num < 1000) return num
    else if (1000 <= num && num < 1000000) return Math.trunc(num / 1000) + Math.trunc((num % 1000) / 100) / 10 + 'K'
    else if (num >= 1000000) return Math.trunc(num / 1000000) + Math.trunc((num % 1000000) / 100000) / 10 + 'M'
}
